-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FRONT-1978: Update @streamr/config
to the "typed" version (v5.5.0) + clean up
#1974
FRONT-1978: Update @streamr/config
to the "typed" version (v5.5.0) + clean up
#1974
Conversation
Isolating this change may cause some mess. Will fix it shortly.
@@ -17,7 +17,7 @@ export default function getClientConfig( | |||
if (chainConfig.entryPoints && chainConfig.entryPoints.length > 0) { | |||
config.network = { | |||
controlLayer: { | |||
entryPoints: chainConfig.entryPoints, | |||
entryPoints: [...chainConfig.entryPoints], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
controlLayer.entryPoints
is a mutable collection while chainConfig.entryPoints
is a read-only collection. ts rightfully complains.
@@ -97,8 +97,6 @@ export function getContractAddress( | |||
return contracts.SponsorshipStakeWeightedAllocationPolicy | |||
case 'sponsorshipVoteKickPolicy': | |||
return contracts.SponsorshipVoteKickPolicy | |||
case 'sponsorshipPaymentToken': | |||
return contracts.SponsorshipPaymentToken |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting! sponsorshipPaymentToken
is properly resolved by this switch
earlier. This here is redundant, plus, sponsorshipPaymentToken
doesn't exist on contracts
anyway.
Issue detected by the typed config. Pretty cool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! The old way was prone to errors. Good to have this now.
In this PR I make sure we're using the latest
@streamr/config
package (exposes proper types for the config and chains). I also clean things up a bit. There's room for more but I don't wanna pollute it just yet (#1965 could be addressed first).Future improvement material
ChainKey
(polygon
,dev0
, …) which could be use to narrow hub's types even further.